package nl.infodation.emr.psrefdata.entity;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="productstype")
public class Product implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "primaryKey")
	@GeneratedValue(strategy=GenerationType.AUTO)
	private long primaryKey;
	
	@Column(name = "productId")
	private int productId;
	
	@Column(name = "productCode")
	private String productCode;

	@Column(name = "family")
	private String family;
	
	@Column(name = "subFamily")
	private String subFamily;
	
	@Column(name = "lotId")
	private long lotId;
	
	@Column(name = "brand")
	private String brand;
	
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.MERGE)
	@JoinColumn(name="CommercialReferencesType_fk", referencedColumnName="primaryKey")
	private CommercialReferences commercialReferences;
	
	

	public long getLotId() {
		return lotId;
	}
	public void setLotId(long lotId) {
		this.lotId = lotId;
	}
	public String getBrand() {
		return brand;
	}
	public void setBrand(String brand) {
		this.brand = brand;
	}
	public String getFamily() {
		return family;
	}
	public void setFamily(String family) {
		this.family = family;
	}
	public String getSubFamily() {
		return subFamily;
	}
	public void setSubFamily(String subFamily) {
		this.subFamily = subFamily;
	}
	public long getPrimaryKey() {
		return primaryKey;
	}
	public void setPrimaryKey(long primaryKey) {
		this.primaryKey = primaryKey;
	}
	public CommercialReferences getCommercialReferences() {
		return commercialReferences;
	}
	public void setCommercialReferences(CommercialReferences commercialReferences) {
		this.commercialReferences = commercialReferences;
	}
	public int getProductId() {
		return productId;
	}
	public void setProductId(int productId) {
		this.productId = productId;
	}
	public String getProductCode() {
		return productCode;
	}
	public void setProductCode(String productCode) {
		this.productCode = productCode;
	}
}
